// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import vuex from 'vuex'
import App from './App'
import router from './router'
import fastclick from 'fastclick'
import less from 'less'
import './assets/styles/reset.css'
import './assets/styles/border.css'
import './assets/styles/iconfont.css'
import store from './store/index.js'
import toastRegistry from './components/toast/index.js'
import VueScroller from 'vue-scroller'
import vuescroll from 'vuescroll'
import echarts from 'echarts'
import Moment from "moment";
import formCreate from '@form-create/ant-design-vue';
import { Form, FormModel, Input, Select, Button, DatePicker, Radio, message, Layout, Menu, Breadcrumb, Table,
  Switch, Checkbox, Row, Col, Icon, Popconfirm, Upload, Modal, Tabs, Tag, Rate, Steps, Descriptions,
  Result, List, Avatar, InputNumber, Spin, ConfigProvider, Pagination, Progress, Tooltip, Empty, Divider, Tree, AutoComplete } from 'ant-design-vue'

// 这里也可以直接执行 toastRegistry()
Vue.use(toastRegistry, VueScroller, vuex, vuescroll, less);
Vue.use(formCreate);
Vue.use(Form);
Vue.use(FormModel);
Vue.use(Input);
Vue.use(Button);
Vue.use(Select);
Vue.use(DatePicker);
Vue.use(Radio);
Vue.use(Switch);
Vue.use(Checkbox);
Vue.use(Col);
Vue.use(Row);
Vue.use(Layout);
Vue.use(Menu);
Vue.use(Breadcrumb);
Vue.use(Icon);
Vue.use(Table);
Vue.use(Popconfirm);
Vue.use(Upload);
Vue.use(Modal);
Vue.use(Tabs);
Vue.use(Tag);
Vue.use(Rate);
Vue.use(Result);
Vue.use(Steps);
Vue.use(Descriptions);
Vue.use(List);
Vue.use(Avatar);
Vue.use(InputNumber);
Vue.use(Spin);
Vue.use(ConfigProvider);
Vue.use(Pagination);
Vue.use(Progress);
Vue.use(Tooltip);
Vue.use(Empty);
Vue.use(Divider);
Vue.use(Tree);
Vue.use(AutoComplete);

Vue.prototype.$message = message;
Vue.prototype.$echarts = echarts;
Vue.prototype.$Modal = Modal;
Vue.prototype.$Moment = Moment;


// 全局路由守卫, 必须加上;
router.beforeEach((to, from, next) => {
  next()
});

message.config({
  duration: 3, // 持续时间
  top: `20px`, // 到页面顶部距离
  maxCount: 3 // 最大显示数, 超过限制时，最早的消息会被自动关闭
});
Vue.config.productionTip = false;
fastclick.attach(document.body);

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
});
